package me.frank.tman.model;

public class StockExchangeModel {
    public static final String BUY = "买入";
    public static final String SELL = "卖出";

    public String code; // 交易股票
    public String name; // 交易股票
    public double price; // 交易股票
    public String exchangeType; // 交易类型
    public long exchangeNum; // 交易数量
    public long volume; // 持仓数量
    public double cost; // 持仓成本
    public double capitalization; // 持仓市值
    public double profit; // 盈亏
    public double exchangeFee; // 单次交易费用
    public long exchangeTime; // 交易时间戳

    public StockExchangeModel() {

    }

    public StockExchangeModel(String code, String name, double price) {
        this.code = code;
        this.name = name;
        this.price = price;
    }

    public StockExchangeModel(String code, String name, double price, double cost) {
        this.code = code;
        this.name = name;
        this.price = price;
        this.cost = cost;
    }

    public StockExchangeModel(StockExchangeModel model) {
        code = model.code;
        name = model.name;
        price = model.price;
        volume = model.volume;
        cost = model.cost;
        capitalization = model.capitalization;
        profit = model.profit;
        exchangeFee = model.exchangeFee;
        exchangeType = model.exchangeType;
        exchangeTime = model.exchangeTime;
        exchangeNum = model.exchangeNum;
    }

    @Override
    public String toString() {
        return "StockExchangeModel{" +
                "code='" + code + '\'' +
                ", name='" + name + '\'' +
                ", price=" + price +
                ", exchangeType='" + exchangeType + '\'' +
                ", exchangeNum='" + exchangeNum + '\'' +
                ", volume=" + volume +
                ", cost=" + cost +
                ", capitalization=" + capitalization +
                ", profit=" + profit +
                ", exchangeFee=" + exchangeFee +
                ", exchangeTime=" + exchangeTime +
                '}';
    }
}
